import java.util.*;

public class Room {

    private final List<Card> allCards = new ArrayList<>();

    {
        String[] nums = {"3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A", "2"};

        String[] colors = {"♠", "♥", "♦", "♣"};

        for (String color : colors) {
            for (String num : nums) {
                Card card = new Card(color, num);

                allCards.add(card);
            }


        }
        allCards.add(new Card("♠", "小王"));
        allCards.add(new Card("♠", "大王"));
        System.out.println("新牌是："+allCards);

    }
    public void start() {
        Collections.shuffle(allCards);
        System.out.println("洗牌后"+allCards);

        Map<String,List<Card>> players = new HashMap<>();

        List<Card> lhc = new ArrayList<>();
        players.put("令狐冲",lhc);
        List<Card> lhc2 = new ArrayList<>();
        players.put("令狐冲2",lhc2);
        List<Card> lhc3 = new ArrayList<>();
        players.put("令狐冲3",lhc3);
        for (int i = 0; i < allCards.size(); i++) {

            Card card = allCards.get(i);
            if(i%3 == 0){
                lhc.add(card);
            }else if(i%3 == 1) {
                lhc2.add(card);
            }else 
                lhc3.add(card);
        }


        for (Map.Entry<String, List<Card>> entry : players.entrySet()) {
            String name = entry.getKey();
            List<Card> cards = entry.getValue();
            System.out.println(name + "的牌是：" + cards);
        }



    }



}



